import {
	defineStore
} from 'pinia'

export const useTransferStore = defineStore('transfer', {
	state: () => ({
		payload: null, // 任意类型都收
		globalData: [],
	}),
	actions: {
		send(data) {
			this.payload = data
		},
		take() {
			const tmp = this.payload;
			this.payload = null;
			return tmp
		},
		setGlobal(data) {
			this.globalData = data
		}
	}
})